Company   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A alternativeNames 0 9 1
A images 0 9 1
A details 0 9 1
1
import { BaseEndpoint } from './baseEndpoint';
2
import {
3
    CompanyAlternativeNamesResponse,
4
    CompanyDetailsResponse,
5
    CompanyImagesResponse,
6
} from '../interfaces/companies';
7
8
/**
9
 * Companies Endpoint Class
10
 */
11
export class Company extends BaseEndpoint {
12
13
    /**
14
     * Get details for specified company
15
     * @param { number } companyID
16
     * @returns { Promise<CompanyDetailsResponse> }
17
     * @see https://developers.themoviedb.org/3/companies/get-company-details
18
     */
19
    public async details(companyID: number): Promise<CompanyDetailsResponse> {
20
        return this.sendGetRequest(`company/${companyID}`);
21
    }
22
23
    /**
24
     * Get alternative names for specified company
25
     * @param { number } companyID
26
     * @returns { Promise<CompanyAlternativeNamesResponse> }
27
     * @see https://developers.themoviedb.org/3/companies/get-company-alternative-names
28
     */
29
    public async alternativeNames(companyID: number): Promise<CompanyAlternativeNamesResponse> {
30
        return this.sendGetRequest(`company/${companyID}/alternative_names`);
31
    }
32
33
    /**
34
     * Get images for specified company
35
     * @param { number } companyID
36
     * @returns { Promise<CompanyImagesResponse> }
37
     * @see https://developers.themoviedb.org/3/companies/get-company-images
38
     */
39
    public async images(companyID: number): Promise<CompanyImagesResponse> {
40
        return this.sendGetRequest(`company/${companyID}/images`);
41
    }
42
43
}
44